package com.bmldyq.family.gateway.controller;

import com.bmldyq.family.gateway.filter.ResponseData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class FallBackController {

    @RequestMapping("/defaultFallBack")
    @ResponseBody
    public ResponseData fallback(){
        ResponseData responseData = new ResponseData();
        responseData.setCode("401");
        responseData.setMsg("交易处理被限流，无法完成请求!");
        log.info("交易处理被熔断，无法完成请求!");
        return responseData;
    }
}
